import request from '@/utils/request'
const bathPath = '/admin/article'
// 获取文章列表
export const getArticles = params => {
  return request.get(bathPath, {
    params
  })
}
// 新增文章
export const addArticle = data => {
  return request.post(bathPath, data)
}
// 更新文章
export const updateArticle = data => {
  return request.put(bathPath, data)
}
// 删除文章
export const deleteArticle = id => {
  return request.delete(`${bathPath}/${id}`)
}
// 获取文章详情
export const getArticleById = id => {
  return request.get(`${bathPath}/${id}`)
}
